//
//  ViewController.m
//  PodDemo
//
//  Created by ShiMac on 15/6/14.
//  Copyright (c) 2015年 guoyan. All rights reserved.
//

#import "ViewController.h"
#import "ButtomAnimationViewController.h"


@interface ViewController ()<UITableViewDataSource , UITableViewDelegate>
{

    UITableView *tableView;
    

}

@property (nonatomic , retain) NSArray *dataAry;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.dataAry=[NSArray arrayWithObjects:@"pop", nil];
    
    tableView = [[UITableView alloc ]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    tableView.delegate=self;
    tableView.dataSource=self;
    tableView.tableHeaderView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 20)];
    tableView.tableFooterView=[[UIView alloc] init];
    
    
    [self.view addSubview:tableView];;
}

-(CGFloat)tableView:(nonnull UITableView *)tableView heightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath{
    
    
    return 70;
}

-(NSInteger)numberOfSectionsInTableView:(nonnull UITableView *)tableView{
    
    
    return 1;
}

-(NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    
    return self.dataAry.count;
}

-(UITableViewCell *)tableView:(UITableView *)tableView_ cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath

{
    
    UITableViewCell *cell=[tableView_ dequeueReusableCellWithIdentifier:@"cell"];
    if (!cell) {
        
        cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        
    }
    
    cell.textLabel.text=[self.dataAry objectAtIndex:indexPath.row];
    return cell;

}

-(void )tableView:(nonnull UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath{
    
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    switch (indexPath.row) {
        case 0:
        {
            ButtomAnimationViewController *controller=[[ButtomAnimationViewController alloc] init];
            UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:controller];
            [self presentViewController:nav animated:YES completion:nil];
            
        
        
        
        }
            break;
            
        default:
            break;
    }
    
    
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
